from setuptools import setup, find_packages, Extension
try:
    from Pyrex.Distutils import build_ext
    no_pyrex = False
except ImportError:
    no_pyrex = True

if no_pyrex:
    cmdclass = {}
    src = ['src/tokyotyrant.c']
else:
    cmdclass = { 'build_ext': build_ext }
    src = ["src/tokyotyrant.pyx"]

setup(
    version = '0.0.1',
    name = "tokyotyrant",
    author='Chihiro Sakatoku',
    author_email='csakatoku@gmail.com',
    url='http://code.google.com/p/python-tokyotyrant/',
    license='MIT License',
    packages=find_packages(exclude=['ez_setup', 'examples', 'tests', 'src']),
    ext_modules=[Extension('tokyotyrant', src,
                           libraries=["tokyotyrant"])],
    cmdclass=cmdclass,
    )
